// 导入封装的axios
import request from '../http'

// 登录接口
export const showStudentList = () => {
    return request({
        url:"/student/list", //http://localhost:8080/user/login 
        method:"get", //get post put delete
    })
}
// 根据ID删除学生
 export const deleteStudentById = (id: number) => {
            return request({
        url: `/delete/${id}`,
        method: 'delete'
    })
 }

// 添加学生
 export const addStudent = (data: any) => {
    return request({
        url: '/student/add',
        method: 'post',
        data
    })
 }

// 更新学生
 export const updateStudent = (data:any) => {
    return request({
        url: '/student/update',
        method: 'put',
        data
    })
 }
 //查询学生
 export const queryStudent = (name: string, phone: string, stage: string) => {
    return request({
        url: '/student/search',
        method: 'get',
        params: {
            name,
            phone,
            stage
        }
    })
 }
